<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<script type="text/javascript" src="${ctx}/static/js/jquery.min.js"></script>
<script type="text/javascript" src="${ctx}/static/js/avalon.shim.js"></script>
<script type="text/javascript" src="${ctx}/static/js/bootstrap.min.js"></script>
<script type="text/javascript" src="${ctx}/static/js/zTree/js/jquery.ztree.all.min.js"></script>
<script type="text/javascript" src="${ctx}/static/js/My97DatePicker/WdatePicker.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/static/js/echarts.min.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/static/js/jquery.flipcountdown.js"></script>
<script type="text/javascript" src="${ctx}/static/layui/lay/dest/layui.all.js" charset="utf-8"></script>
<script type="text/javascript" src="${ctx}/static/js/function.js" charset="utf-8"></script>
<script>
    function showBar(option, divId) {
        var myChart = echarts.init(document.getElementById(divId));
        myChart.setOption(option);
    }
    $(function () {
        document.onkeydown = function (e) {
            var ev = document.all ? window.event : e;
            if (ev.keyCode == 13) {
                loadSearchData();
            }
        }
    });
    //关闭对话框
    function closeDialog() {
        layui.layer.closeAll();
    }
    //得到当前的日期
    function getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        var hour = date.getHours();
        var minute = date.getMinutes();
        var second = date.getSeconds();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        if (hour >= 0 && hour <= 9) {
            hour = "0" + hour;
        }
        if (minute >= 0 && minute <= 9) {
            minute = "0" + minute;
        }
        if (second >= 0 && second <= 9) {
            second = "0" + second;
        }
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
            + " " + hour + seperator2 + minute + seperator2 + second;
        return currentdate;
    }
    // 不知道谁写的简单版的坑爹正则
    function isURL(str) {
        return !!str.match(/(http[s]?):\/\//g);
    }
    //图片url过滤器
    avalon.filters.img = function (str) {
        if (isURL(str)) {
            return "<img src='" + str + "'>";
        }
        return str;
    }
</script>